package Java_object0820;

public class Car {
    public int price;   //价格
    public int x;      //坐标
    public int oilNum;  //油量

    public void addOil(int num){
        oilNum+=num;
    }

    public void run(int s){
        x+=s;
        oilNum-=s/2;
        price-=s/10;
    }

    public void getInform(){
        System.out.println("-----------");
        System.out.println("价格："+price+"  "+"坐标："+x+"  "+"油量："+oilNum+"  ");
    }
}
